import request from '@/utils/request'

export function selectAll(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/formTemplate/selectAll?currentPage=' + params.currentPage + '&pageSize=' + params.pageSize,
    method: 'get'
  })
}
export function selectByName(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/formTemplate/selectByName',
    method: 'post',
    data: params
  })
}

export function selectContentById(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/formTemplate/selectContentById?id=' + id,
    method: 'get'
  })
}

export function copyById(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/formTemplate/copyById?id=' + id,
    method: 'get'
  })
}

export function createForm(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/formTemplate/create',
    method: 'post',
    data: params
  })
}

export function deleteForm(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/formTemplate/delete?id=' + id,
    method: 'get'
  })
}

export function formUpdateContent(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/formTemplate/updateContent',
    method: 'post',
    data: params
  })
}

export function deleteBatch(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/formTemplate/deleteBatch',
    method: 'post',
    data: params
  })
}
